import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-05-13
 * Time: 18:43
 */
//调整数组顺序使得奇数位于偶数之前。调整之后，不关心大小顺序。
public class test {
    public static void fun(int[] arr){
        int k=0;
        for (int i = 0,c=0; i < arr.length; i++) {
            if(arr[i]%2==1) {
                c=arr[k];
                arr[k] = arr[i];
                arr[i]=c;
                k++;
            }
        }
    }
    public static void main(String[] args) {
        int[] arr={1,2,3,4,5,6,7,8,9};
        fun(arr);
        String str=Arrays.toString(arr);
        System.out.println(str);
    }
}
